<%--
  Created by IntelliJ IDEA.
  User: wuyanshen
  Date: 2019/1/13
  Time: 11:27 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录</title>

    <script>
        function toRegister() {
            document.getElementById("loginDIV").style.display="none";//隐藏
            document.getElementById("registerDIV").style.display="";//显示
        }

        function onSubmitChek() {

        }

        function toLogin() {
            document.getElementById("loginDIV").style.display="";//显示
            document.getElementById("registerDIV").style.display="none";//隐藏
        }
    </script>
</head>
<body>

<%--登录页面--%>
<div id="loginDIV">
    <form action="/shiro/login" method="post">
        <table align="center">

            <tr>
                <th>
                    ${msg}
                </th>
            </tr>
            <tr>
                <th>
                    <h2>登录页面</h2>
                </th>
            </tr>
            <tr>
                <th>
                    用户名:<input type="text" name="loginName">
                </th>
            </tr>
            <tr>
                <th>
                    密码:<input type="password" name="password">
                </th>
            </tr>
            <tr>
                <th>
                    记住我<input type="checkbox" name="isRememberMe" >
                </th>
            </tr>
            <tr>
                <th>
                    <input type="submit" value="登录"><input type="button" onclick="toRegister()" value="注册">
                </th>
            </tr>
        </table>
    </form>
</div>

<%--注册页面--%>
<div id="registerDIV" style="display: none" onsubmit="register()">
    <form id="registerForm" action="/shiro/register" method="post">
        <table align="center">

            <tr>
                <th>
                    ${regMsg}
                </th>
            </tr>
            <tr>
                <th>
                    <h2>注册页面</h2>
                </th>
            </tr>
            <tr>
                <th>
                    用户名:<input type="text" name="loginName">
                </th>
            </tr>
            <tr>
                <th>
                    密码:<input type="password" name="password">
                </th>
            </tr>
            <tr>
                <th>
                    昵称:<input type="text" name="nickName">
                </th>
            </tr>

            <input type="hidden" name="isLocked" value="0">

            <tr>
                <th>
                    <input type="submit" value="注册"><input type="button" onclick="toLogin()" value="去登录">
                </th>
            </tr>
        </table>
    </form>
</div>

</body>
</html>
